Game centered on building nontrivial computer programs

ABSTRACT

A game in which players modify a nontrivial computer program. Players with competing objectives are given the option of appending instructions ( 6 ) to the program, as well as performing special actions ( 5 ) such as inserting, deleting, or moving instructions. As the players modify the program, the program executes, modifying variables and potentially moving players closer to or further from their objectives. In addition to serving as a source of enjoyment, the game may be used in an educational context to teach and reinforce computer programming concepts such as conditional branching, looping, and multithreading.

BACKGROUND

This invention relates to the field of games, and specifically that ofgames employing computer programming concepts. Some existing gamesemploy language from the domain of computer programming and attempt toreplicate some aspects of real life computer programming. This categoryof game can provide both enjoyment and educational opportunities.However, these games may not offer an experience that is as rich,engaging, and educational as possible.

U.S. Pat. No. 6,135,451 to Kholodov (2000) describes a game in whichplayers advance through a computer program, but the program is fixed,and advancement through the program is dictated by a die roll.

U.S. Pat. No. 5,078,403 to Chernowski (1992) describes a game that useswords and phrases from computer programming in its naming conventions,such as “program”, “storage area”, “byte”, and ‘I/O’. However, theconcept of a “program” that appears in this game is neither executablenor modifiable.

U.S. Pat. No. 4,258,922 to Landry (1981) describes a game in whichoperations are performed on binary digits. Again, no concept of amodifiable computer program exists.

The game RoboRally published by Wizards of the Coast (1994) allowsplayers to create a simple program that controls the actions of a gamepiece representing a robot. While this game does feature user-modifiablecomputer programs, the programs are extremely limited in scope. They areof limited length (5 instructions), and are limited to simple linearexecution. That is to say, no control flow concepts such as branching orlooping are introduced.

SUMMARY

The game described herein is one in which users modify a computerprogram that executes as the users are modifying it. The program isrepresented by movable instructions (which could be implemented as cardsor tiles in a physical embodiment) and can become arbitrarily complex,limited only by the number of instructions available. The program canemploy programming constructs such as conditional branching, looping,and multithreading.

The players have competing objectives tied to the values of variablesthat are modified as the program executes. Each player attempts tomodify the program, or otherwise alter the state in which it isexecuting, in order to accomplish his or her objective. In order to besuccessful at the game, players must think like a computer programmerand find ways to make the program accomplish the user's goal.

DRAWINGS

FIG. 1 depicts samples of cards or tiles used in a physical embodimentof the game.

FIG. 2 depicts a possible starting configuration for the game.

FIG. 3 depicts the execution of a simple sequence of instructions.

FIGS. 4A and 4B depict the execution of an “if” block when the relevantcondition is true (4A) and when the relevant condition is false (4B).

FIG. 5 depicts the execution of a “while” block.

FIG. 6 depicts the composition of “if” and “while” blocks, creating anested program structure.

FIG. 7 depicts the execution of multiple instruction pointers.

FIG. 8 depicts an electronic embodiment of the game.

DETAILED DESCRIPTION OF DRAWINGS

FIG. 1 shows elements of a physical embodiment of the game such as acard game. Variable counters (1, 2) are used to update and display thecurrent values of named variables. (In a card game embodiment, a smallobject such as a coin would be placed on each counter card to indicatethe current value of the variable represented by the counter.) A nextinstruction pointer (3) is included in order to indicate the nextinstruction to be executed. (In a card game embodiment, the nextinstruction pointer would be positioned to literally point at the nextinstruction.) A dedicated first instruction (4) may be included with thegame in order to simplify the process of starting a new game. Specialactions (5) are tokens (cards in a card game embodiment) that allow theplayer in possession of the token to perform a special action that theplayer would ordinarily not be allowed to take. The three sample specialactions in the diagram allow the bearer to insert an instruction intothe middle of an existing program, trade hands with an opponent, andintroduce a new next instruction pointer, respectively. Instructions (6)are the movable components that make up the computer programs that arecentral to the game. The three sample instructions have the effect ofnegating the variable “i”, subtracting the value of the variable “i”from the variable “x”, and beginning a while-loop conditional on thevariable “i” being less than two, respectively.

FIG. 2 depicts a possible starting configuration for the game. Variablecounters (1, 2) are initialized to a starting value (which is the valuezero in this embodiment), depicted as a large black dot. In a card gameembodiment of the game, this would be accomplished by placing an objectsuch as a coin on each variable counter card. The first instruction (4)is placed in the field of play to begin the program. The nextinstruction pointer (3) points to the first instruction to indicate thatit is the next instruction to be executed. The empty space (7) below theprogram is where the next instruction will be added, unless a specialaction is used to add an instruction to a different location.

FIG. 3 depicts the execution of a simple, linear sequence ofinstructions (6). When the first instruction, bearing the text “i=1”, isexecuted, the variable counter representing “i” (2) is set to the valueof positive one, and the next instruction pointer (3) is moved to pointto the next instruction. When the second instruction, bearing the text“i=−i”, is executed, the variable counter representing “i” (2) isnegated, meaning that its value is modified from positive one tonegative one, and the next instruction pointer (3) is moved to point tothe next instruction. When the third instruction, bearing the text“x=x−i”, is executed, the value of the variable “i” is subtracted fromthe value of the variable “x”, resulting in the counter representing “x”(1) being set to the value of positive one, and the next instructionpointer (3) is moved to point to the empty space below the lastinstruction (7). At this point, the next instruction pointer cannotadvance until either an instruction is added to the program, or aspecial action is played which alters the location of the nextinstruction pointer.

FIG. 4A depicts the layout of an “if” block, and the sequence ofinstructions executed when the relevant condition is true. An “if”instruction (8) is followed by an indented block of instructions (9), inthis case consisting of two instructions. Additional instructions (notindented) may follow the “if” block, as is the case in this example. Forthe purposes of this example, assume that the variable countersrepresenting “x” (1) and “i” (2) are initially set to zero and positiveone, respectively. When the “if” instruction (8) is executed, thecondition contained within parentheses, i.e. “i>0”, is evaluated.Because the condition is true, the next instruction pointer (3) is movedto the indented block (9) and points to the instruction immediatelyunder the “if” instruction. When the first indented instruction, bearingthe text “i=min(i+1,5)”, is executed, the variable counter representing“i” (2) is incremented from positive one to positive two, and the nextinstruction pointer (3) is moved to point to the next instruction. Whenthe second indented instruction, bearing the text “i=−i”, is executed,the variable counter representing “i” (2) is negated, meaning that itsvalue is modified from positive two to negative two, and the nextinstruction pointer (3) is moved to point to the next instruction, i.e.the instruction below which is not indented. When the last instruction,bearing the text “x=x−i”, is executed, the value of the variable “i” issubtracted from the value of the variable “x”, resulting in the counterrepresenting “x” (1) being set to the value of positive two.

FIG. 4B depicts the same “if” block that appears in FIG. 4A, but showsthe sequence of instructions executed when the relevant condition isfalse. For the purposes of this example, assume that the variablecounters representing “x” (1) and “i” (2) are initially set to zero andnegative one, respectively. When the “if” instruction (8) is executed,the condition contained within parentheses, i.e. “i>0”, is evaluated.Because the condition is false, the next instruction pointer (3) skipsthe indented block (9) and is moved to point to the next instruction atthe same level of indentation as the “if” instruction (8). When thatlast instruction, bearing the text “x=x−i”, is executed, the value ofthe variable “i” is subtracted from the value of the variable “x”,resulting in the counter representing “x” (1) being set to the value ofpositive one.

FIG. 5 depicts the execution of a “while” block. A “while” instruction(10) is followed by an indented block of instructions (11), in this caseconsisting of two instructions. Additional instructions (not indented)may follow the “while” block, as is the case in this example. When the“while” instruction (10) is executed, the condition contained withinparentheses, i.e. “i<2”, is evaluated. As with an “if” instruction: ifthe condition is true, the next instruction pointer (3) is moved to theindented block (11) and points to the instruction immediately under the“while” instruction; if the condition is false, the next instructionpointer (3) skips the indented block (11) and is moved to point to thenext instruction at the same level of indentation as the “while”instruction (10). Unlike an “if” block, however, when the last indentedinstruction is executed, the next instruction pointer (3) is moved backto point to the “while” instruction (10).

FIG. 6 depicts the composition of “if” and “while” blocks, creating anested program structure. “If” instructions (8) and “while” instructions(10) require that the instruction below be indented by an additionallevel of indentation, regardless of the number of existing levels ofindentation. There is no limit on the number of levels of indentation;both “if” instructions (8) and “while” instructions (10) can be includedwithin indented “if” and “while” blocks. Also shown are an “else”instruction (12), which if present must appear at the same level ofindentation as an “if” instruction (8), and a “break” instruction (13)which if present must appear within a “while” block. The movement of thenext instruction pointer (3) is determined by composing the rules thatapply to “if” and “while” blocks.

FIG. 7 depicts the execution of multiple instruction pointers. Anembodiment may allow for the existence of multiple next instructionpointers. In this illustration, two next instruction pointers (3) and(14) have different priorities, indicated by a number appearing on each.In order to advance these pointers, firstly the higher priority nextinstruction pointer (3) would be handled: the instruction to which itpointed would be evaluated, and then it would move according to therules for advancing pointers, in this case moving to a “while”instruction above the instruction just executed. Secondly the lowerpriority next instruction pointer (14) would be handled: the instructionto which it pointed would be evaluated, and then it would move accordingto the rules for advancing pointers, in this case moving to theinstruction just below the instruction just executed.

FIG. 8 depicts an electronic embodiment of the game. A mobile device(850) displays the current program (851) and the current player'savailable instructions and special actions (852). Variable counters(801, 802) display the current values of named variables. A nextinstruction pointer (803) indicates the next instruction to be executed.In an electronic implementation, the empty space below the existingprogram (807) can be explicitly visually represented.

REFERENCE NUMERALS

-   (1) variable counter (for the variable “x”)-   (2) variable counter (for the variable “i”)-   (3) next instruction pointer-   (4) example first instruction used to start the game-   (5) example special actions-   (6) example instructions-   (7) empty space below computer program-   (8) “if” instruction-   (9) block indented below “if” instruction-   (10) “while” instruction-   (11) block indented below “while” instruction-   (12) “else” instruction-   (13) “break” instruction-   (14) secondary next instruction pointer-   (801) variable counter (for the variable “x”)-   (802) variable counter (for the variable “i”)-   (803) next instruction pointer-   (807) empty space below computer program-   (850) mobile electronic device-   (851) view of current computer program-   (852) view of current player's available set of instructions and    special actions

DESCRIPTION AND OPERATION OF FIRST EMBODIMENT

The description below explains one embodiment of the invention: a cardgame in which two competing players take turns modifying the samecomputer program until one of them achieves his or her objective. Oneplayer, “Positive”, has the goal of setting the variable “x”,represented by a variable counter (1), to the value of positive five.The other player, “Negative”, has the goal of setting the variable “x”to the value of negative five.

Types of Cards

This embodiment of the game is played with a special deck of cards, plusmarker pieces (such as coins) placed on variable counter cards (1, 2) inorder to represent a variable's current value. The cards fall into threecategories. It makes sense to use a different color scheme for the facesof each category, to make them easily distinguishable. The categoriesare described below:

Start Cards are the cards used to begin the game: variable counters (1,2), a next instruction pointer (3), and a first instruction (4). Thefirst instruction, also an Instruction Card, is used to start the game.

Instruction Cards represent instructions that make up the commonprogram. There are two types of instruction cards: Assignments, whichmodify the value of a variable, and Control Flow Instructions, whichaffect the movement of the next instruction pointer (3). FIG. 1 includesdepictions of sample Instructions (6).

Special Action Cards allow the bearer to perform a special action suchas modifying the program. The bearer must expend either one or twoactions (explained below), depending on the card, in order to play it.FIG. 1 includes depictions of sample Special Action Cards (5).

Beginning the Game

The first instruction (4) (the Instruction Card bearing the text “i=1”)is placed on the gaming table, and the next instruction pointer card (3)is placed to its left. As the game is played, additional InstructionCards will be placed on the table below the first instruction, and thischain of cards will be referred to as “the program”. The two variablecounter cards, “x” (1) and “i” (2), are placed to the right of the firstinstruction (4), and a coin is placed at the zero position on eachcounter card to indicate the current value of that variable. All of theremaining cards (Instruction Cards and Special Action Cards) areshuffled, and each player is randomly assigned a different sign,“Positive” or “Negative”, indicating the direction in which they areattempting to move the variable “x”. Player “Negative” is dealt fourcards and plays the odd numbered turns (first turn, third turn, fifthturn, etc.). Player “Positive” is dealt five cards and plays the evennumbered turns (second turn, fourth turn, etc.). The initial setup isdepicted in FIG. 2.

Turn Sequence

On a player's turn he or she takes two actions, and then advances thenext instruction pointer(s) (in numbered order if more than one pointerexists). The key concept of advancing a next instruction pointer isexplained later. The player may choose from five types of actions:

1. Play an Instruction Card

The player places an Instruction Card from his hand on the table at thebottom of the program (beneath the last card), adding to the existingprogram. If the card above is a Control Flow Instructions such as an“if” or “while” instruction, the new card must be placed at an indent.(A downward arrow might appear on Control Flow Instructions indicatingwhere to align the left side of the next card.) Otherwise, the card maybe placed at any level of indentation between that of the firstinstruction and that of the card above. Two special Instruction Cardsmust adhere to additional rules: an “else” card must match a preceding“if”, and a “break” card can only be played within a while loop(explained later).

2. Play a Special Action Card

Special Action Cards allow the player to do something other than addingan instruction to the end of the program. Examples of special actionsinclude adding or removing Instruction Cards from the program,introducing a new next instruction pointer, and trading hands with one'sopponent. The face of each such card contains text explaining theaction.

The Special Action Cards labeled “Insert”, “Move”, and “Delete” can beapplied to any Instruction Card in the program as long as (A) no nextinstruction pointer points to the card being moved or deleted, and (B)the rules governing the relative positions of instructions, describedabove, can be satisfied simply by adjusting indentations. (As an exampleof a modification after which the rules could not be satisfied simply byadjusting indentations: in the case of a matching “if” and “else”instruction pair, the deletion of the “if” instruction would leave an“else” instruction with no matching “if”, and thus such a deletion wouldnot be allowed.) Following the modification, the player slides cards upor down so that each card sits below its predecessor (next instructionpointers travel with the card to which they originally pointed). Thenthe player makes any indentation adjustments required to avoid violatingindentation rules, working from the top of the program downward. If anext instruction pointer pointed to the space below the program, then aninstruction moved into the empty space will be pointed to and willexecute during the “Advance Next Instruction Pointers” phase.

The Special Action Cards labeled “Set Next” and “New Thread” can be usedto position a next instruction pointer at any Instruction Card,regardless of what conditions appear above it. (But that nextinstruction pointer does not advance or execute during the “Advance NextInstruction Pointers” phase of the current turn.)

Powerful Special Action Cards such as “Set Next” require the player tospend both actions in order to play the card. (This requirement isindicated on the card itself.)

After a Special Action Card is played, it and any card removed from theprogram as a result of the action are deposited into a “discard pile”.

3. Draw a Card (if Permitted)

If the player's hand contains less than five cards, he or she may draw anew card. If the deck is empty, the discard pile is reshuffled to becomethe new deck.

4. Discard a Card

The player may discard a card. (Drawing a replacement card is a separateaction.)

5. Advance any Next Instruction Pointer

A player can opt to use an action to advance any one (not all) nextinstruction pointers. This is in addition to the advancement of pointersthat must occur at the end of the turn. When multiple next instructionpointers are in play, this action can be used to e.g. advance a lowerpriority next instruction pointer (labeled with a number indicatinglower priority) before a higher priority next instruction pointeradvances naturally.

Ending the Game

The game ends when the value of the variable “x” (1) reaches or exceedsthe value positive five (in which case player “Positive” wins), ornegative five (in which case player “Negative” wins). Entering thisstate immediately ends the game.

Executing the Program (Advancing the Next Instruction Pointers)

The most fundamental concept in the game is that of advancing a nextinstruction pointer, or in other words executing the current program.Unless the next instruction pointer points to the empty space below theprogram (7), this is done by (A) executing (performing the actiondescribed on) the Instruction Card pointed to by the next instructionpointer, and (B) moving the next instruction pointer to point to thenext instruction to be executed. This is often the followinginstruction, but not always. A simple sequence of instructions isdepicted in FIG. 3.

In this example, advancing the next instruction pointer (3) consists ofexecuting the instruction to which it points, and then sliding it downto the next card. Advancing it three times results in executing theinstruction “i=1” (setting the value of “i” (2) to positive one), thenexecuting the instruction “i=−i” (setting the value of “i” (2) tonegative one), and lastly executing “x=x−i” (setting the value of “x”(1) to positive one). This leaves the next instruction pointer pointingto the empty space (7) just below the last card in the program. Once thenext instruction pointer is pointing to this empty space, it ceases toadvance until either a new instruction is played into the empty space,or a special action has the effect of moving the next instructionpointer to point to an instruction.

Conditionals

An “if” card represents a conditional: a special instruction thataffects the flow of control. If the condition that appears inparentheses after the “if” is true, then when the next instructionpointer advances, its next stop is the instruction indented under the“if” card. This procession is illustrated in FIG. 4A.

If the condition is false, however, then the set of cards indented belowthe “if” (known as the “if” block) is skipped. The next instructionpointer advances as if the indented instructions did not exist, as shownin FIG. 4B.

The “else” card is a special card that can only follow an “if” at thesame indentation. The next instruction pointer advances from the “else”card to the card indented under it only if the preceding “if” card'scondition is false.

While Loops

A “while” card represents another type of instruction that affects theflow of control. As with an “if” card, the cards indented beneath the“while” card are only visited if the condition in parentheses is true.Unlike in an “if” block, however, at the end of a closed “while” block,the next instruction pointer returns to the “while” card at the top ofthe loop. This procession is illustrated in FIG. 5.

If the last card in the indented block (11) is an Assignment (as must bethe case if any cards exist later in the program at the same indentationas or to the left of the “while” card), then the “while” block is a“closed while loop,” and from the last card in the block the nextinstruction pointer advances to the “while” card above. Otherwise, theloop is “open” and the next instruction pointer advances to the emptyspace below the last card.

The “break” card is a special card that can only occur in a while loop.From the “break” card, the next instruction pointer advances to the samecard that would have been advanced to from the “while” card above hadits condition been false.

Nested Control Flow

When an “if” or a “while” are played indented beneath another “if” or“while”, they are said to be “nested”. An example of nesting is shown inFIG. 6. Nesting enables the construction of complex computer programs,and allows the number of levels of indentation to grow arbitrarilylarge.

Next Instruction Summary

In summary, when advancing a next instruction pointer: if the nextinstruction pointer points to the space below the program (7), nothinghappens; otherwise the next instruction visited after executing anyinstruction other than “break” is determined by the indentation of thecard below it.

Same indentation: Advance to the card below.

Greater indent (to the right): If the relevant condition is true (falsein the case of an “else”), advance to the instruction indented below thecurrent instruction. Otherwise, advance as if the instructions in theindented block did not exist.

Lesser indent (to the left): If the current instruction is contained ina while loop, advance to the (most inner) “while” card above. Otherwise,advance to the card below.

No cards below: If the current instruction is an Assignment and iscontained within a while loop, then advance to the “while” card above.Otherwise, advance to the empty space below the last card in theprogram, even if this means proceeding past an “if” or “while” cardwhose condition is false.

Multiple Threads (Multiple Next Instruction Pointers)

In most modern computer systems, and in this game, it is possible formultiple next instruction pointers to simultaneously execute the sameprogram, and to interact with each other. These are known as “threads”,and Special Action Cards can introduce new threads. In this game, eachnext instruction pointer is labeled with a priority number indicatingits priority relative to other next instruction pointers; higherpriority next instruction pointers execute before lower priority nextinstruction pointers. If two next instruction pointers point to the sameinstruction, position the cards such that each arrow's priority numberis visible. FIG. 7 depicts a scenario in which multiple threads advance.First the next instruction pointer labeled “NEXT (1)” (3) executes (theinstruction labeled “i=max(i−1,−5)”), and then advances (up to theinstruction labeled “while(i>−2)”). Then the next instruction pointerlabeled “NEXT (3)” (14) executes (the instruction labeled “x=x−1”), andthen advances (to the instruction labeled “ i=max(i−1,−5)”).

DESCRIPTION AND OPERATION OF ALTERNATE EMBODIMENT

The description below explains an alternate embodiment of the invention:an electronic game in which two competing players take turns modifyingthe same computer program until one of them achieves his or herobjective. (As in the first embodiment, one player, “Positive”, has thegoal of setting the variable “x” to the value of positive five. Theother player, “Negative”, has the goal of setting the variable “x” tonegative five.) Such an electronic game could be implemented as a mobiledevice game, a computer game, or a web-based game, but the descriptionbelow and the drawing FIG. 8 focus in particular on a mobile devicegame.

Objects and Visual Representations

This embodiment of the game is played on a mobile device (850). As inthe first embodiment, variable counters (801, 802) display eachvariable's current value. Instructions are arranged to represent acomputer program (851), and a next instruction pointer (803) indicatesthe next instruction to be executed. As in the first embodiment, eachplayer has at his or her disposal a set of playable objects (852)consisting of instructions and special actions.

Beginning the Game

As in the first embodiment, the arrangement of instructions known as“the program” (851) initially consists of only a single instructionbearing the text “i=1”, pointed to by the next instruction pointer(803). As the game is played, players add additional instructions to theprogram, extending it. Variable counters (801, 802) are initialized tozero and display their current value. Each player is randomly assigned adifferent sign, “Positive” or “Negative”, indicating the direction inwhich they are attempting to move the variable “x”. Each player is thenallocated playable objects (852), instructions and special actions,randomly drawn from a predetermined set. Player “Negative” is allocatedfour objects and plays the odd numbered turns (first turn, third turn,fifth turn, etc.). Player “Positive” is allocated five objects and playsthe even numbered turns (second turn, fourth turn, etc.).

Turn Sequence

On a player's turn he or she takes two actions, after which the gameautomatically advances the next instruction pointer(s) (in numberedorder if more than one pointer exists). The rules governing how a nextinstruction pointer advances are the same as those explained in thedescription of the first embodiment. The player may choose from fivetypes of actions:

1. Play an Instruction

The player drags an instruction from his set of objects (852) into theempty space at the bottom of the program (807), adding to the existingprogram. If the instruction above is a Control Flow Instruction such asan “if” or “while” instruction, the new instruction must be placed at anindent. (A downward arrow might be used as a visual cue to indicate theindentation requirement.) Otherwise, the instruction may be placed atany level of indentation between that of the top instruction and that ofthe instruction above. Two special instructions must adhere toadditional rules: an “else” instruction must match a preceding “if”, anda “break” instruction can only be played within a while loop (explainedin the description of the first embodiment).

2. Play a Special Action

Special Actions allow the player to do something other than adding aninstruction to the end of the program. Examples of special actionsinclude adding or removing instructions from the program, introducing anew next instruction pointer, and trading sets of objects with one'sopponent. Briefly tapping a special action will display additional texton the screen explaining the action. Pressing and holding one's fingeron a special action will cause the action to be played, potentiallyprompting the user to do something to further specify the action. Forexample if the special action were a “Move” action, the user would thenbe required to drag an instruction from one location in the program to adifferent location in the program.

The Special Actions labeled “Insert”, “Move”, and “Delete” can beapplied to any instruction in the program as long as (A) no nextinstruction pointer points to the instruction being moved or deleted,and (B) the indentation rules described above can be satisfied simply byadjusting indentations. Following the modification, the gameautomatically slides instructions up or down so that each instructionsits below its predecessor (next instruction pointers travel with theinstruction to which they originally pointed). The game also makes anyindentation adjustments required to avoid violating indentation rules,working from the top of the program downward. The game may dynamicallyrearrange instructions as the user drags an instruction to a newlocation, in order to illustrate to the user the effect of dropping theinstruction at a particular location.

The Special Actions labeled “Set Next” and “New Thread” can be used toposition a next instruction pointer at any instruction, regardless ofwhat conditions appear above it. (But that next instruction pointer isnot automatically advanced or executed at the end of the current turn.)

Note that powerful Special Actions require the player to spend bothactions in order to play the action (indicated visually on therepresentation of the special action).

3. Draw a New Playable Object (if Permitted)

If the player is in possession of less than five playable objects, he orshe may draw a new object.

4. Discard an Object

The player may discard an instruction or special action. (Drawing areplacement is a separate action.)

5. Advance any Next Instruction Pointer

A player can opt to use an action to advance any one (not all) nextinstruction pointers. This is in addition to the advancement of pointersthat automatically occurs at the end of the turn.

Ending the Game

The game ends when the value of the variable “x” (801) reaches orexceeds the value positive five (in which case player “Positive” wins),or negative five (in which case player “Negative” wins). Entering thisstate immediately ends the game.

Execution of the Program (Advancing the Next Instruction Pointers)

In this embodiment, next instruction pointers advance as they do in thefirst embodiment. Unless the next instruction pointer points to theempty space below the program (807), the instruction pointed to isexecuted, and then the pointer moves to point to the next instruction tobe executed. As in the first embodiment, conditionals can cause the nextinstruction pointer to skip blocks of instructions, while loops cancause the instruction pointer to move up rather than down, and suchconstructs can be nested within each other. Also as with the firstembodiment, special actions can introduce new next instruction pointers,each with a unique priority number. Unlike in the first embodiment,however, in this embodiment, next instruction pointers are advancedautomatically by the game itself.

1. A game, with the following features: moveable representations ofcomputer instructions (such as assignment instructions, conditionalinstructions, and looping instructions), whether physical or virtual,that may be arranged to define a computer program, and a system, whethermanual or automated, for executing the computer program
 2. The game ofclaim 1 wherein one or more modifiable counters are used to record thecurrent values of variables used in the computer program.
 3. The game ofclaim 2 wherein players have the option of appending instructions froman available set of instructions to an existing program.
 4. The game ofclaim 3 wherein players have the option of taking actions from anavailable set of special actions such as inserting instructions into themiddle of the program, deleting instructions, moving instructions, ordirectly modifying the values of variables
 5. The game of claim 4wherein the instructions, counters, and special actions are implementedas physical cards comprising a deck of cards.
 6. The game of claim 4implemented as an application running on a computer system wherein theinstructions, counters, and special actions are depicted visually on thescreen.
 7. The game of claim 4 implemented as an application running ona mobile device wherein the instructions, counters, and special actionsare depicted visually on the screen.
 8. The game of claim 4 implementedas a web application, wherein the implementation of the game exists on aweb server and players play the game on devices remotely connected tothe web server.
 9. The game of claim 4 wherein the actions of theplayers and the execution of the program occur in a consistent, orderedsequence, i.e. players take turns and program execution is triggered byplayer actions.
 10. The game of claim 4 wherein the actions of theplayers and the execution of the program are not synchronized, i.e.execution of the program is not suspended while a player is decidingupon his or her next move.
 11. The game of claim 4 wherein theinstructions and special actions available to each player are determinedby chance, for example by drawing such options from a deck of cards. 12.The game of claim 4 wherein the instructions or special actionsavailable to each player are drawn from a predefined set.
 13. The gameof claim 4 wherein the program is executed as a multithreaded program,i.e. multiple pointers point to a next instruction.
 14. The game ofclaim 4 wherein the set of available instructions includes the abilityto perform a function call, and multiple counters are used to storevalues for a single named variable, allowing simulated program to effecta call stack.